classDiagram
    class Subject {
        +List~Observer~ observers
        +register(observer: Observer)
        +deregister(observer: Observer)
        +notify()
    }
    
    class Observer {
        <<interface>>
        +update(subject: Subject)
    }

    class ConcreteSubject {
        -state: String
        +getState(): String
        +setState(state: String)
    }

    class ConcreteObserverA {
        +update(subject: Subject)
    }

    class ConcreteObserverB {
        +update(subject: Subject)
    }

    Subject <|-- ConcreteSubject
    Observer <|.. ConcreteObserverA
    Observer <|.. ConcreteObserverB
    ConcreteSubject --> Observer : notifies
